<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Sifteo SDK: bg1.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-style-overrides.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<center>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Sifteo SDK" src="sdk_logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">
   &#160;<span id="projectnumber">v1.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</center>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li><a href="pages.html"><span>Guides</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_12cda917fe1d7c8b4e7d2501bb3636e4.html">sdk</a></li><li class="navelem"><a class="el" href="dir_2f23e30b638d6a5f333babd9a5d183e1.html">include</a></li><li class="navelem"><a class="el" href="dir_d5ace589187da7c83c1a7507ec9fbbef.html">sifteo</a></li><li class="navelem"><a class="el" href="dir_483499650334b406c1d3bbaf3a730f60.html">video</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">bg1.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/* -*- mode: C; c-basic-offset: 4; intent-tabs-mode: nil -*-</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * This file is part of the public interface to the Sifteo SDK.</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Copyright &lt;c&gt; 2012 Sifteo, Inc. All rights reserved.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#ifdef NOT_USERSPACE</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#   error This is a userspace-only header, not allowed by the current build.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;sifteo/abi.h&gt;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;sifteo/macros.h&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;sifteo/math.h&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;sifteo/asset.h&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="keyword">namespace </span>Sifteo {</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_mask.html">   36</a></span>&#160;<span class="keyword">struct </span><a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> {</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="comment">// Matches the memory layout of BG1, but uses faster 32-bit arithmetic.</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    uint32_t row10;</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    uint32_t row32;</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    uint32_t row54;</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    uint32_t row76;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    uint32_t row98;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    uint32_t rowBA;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    uint32_t rowDC;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    uint32_t rowFE;</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a61de7de1ea11bb2259a2f0342dd6c951">   50</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> <a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a61de7de1ea11bb2259a2f0342dd6c951" title="Create an empty mask. All bits are zero.">empty</a>() {</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> result = { 0, 0, 0, 0, 0, 0, 0, 0 };</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    }</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a8fbfd70038517697b6e01a8a9cdc7f76">   64</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> <a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a8fbfd70038517697b6e01a8a9cdc7f76" title="Create a mask with a filled rectangle it.">filled</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> topLeft, <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> size) {</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;        <span class="keywordtype">unsigned</span> xBits = ((1 &lt;&lt; size.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a>) - 1) &lt;&lt; topLeft.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a>;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        <span class="keywordtype">unsigned</span> yBits = ((1 &lt;&lt; size.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a>) - 1) &lt;&lt; topLeft.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a>;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        <span class="keywordtype">unsigned</span> row0 = yBits &amp; 0x0001 ? xBits : 0;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        <span class="keywordtype">unsigned</span> row1 = yBits &amp; 0x0002 ? xBits : 0;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        <span class="keywordtype">unsigned</span> row2 = yBits &amp; 0x0004 ? xBits : 0;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        <span class="keywordtype">unsigned</span> row3 = yBits &amp; 0x0008 ? xBits : 0;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        <span class="keywordtype">unsigned</span> row4 = yBits &amp; 0x0010 ? xBits : 0;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        <span class="keywordtype">unsigned</span> row5 = yBits &amp; 0x0020 ? xBits : 0;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        <span class="keywordtype">unsigned</span> row6 = yBits &amp; 0x0040 ? xBits : 0;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        <span class="keywordtype">unsigned</span> row7 = yBits &amp; 0x0080 ? xBits : 0;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <span class="keywordtype">unsigned</span> row8 = yBits &amp; 0x0100 ? xBits : 0;</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        <span class="keywordtype">unsigned</span> row9 = yBits &amp; 0x0200 ? xBits : 0;</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        <span class="keywordtype">unsigned</span> rowA = yBits &amp; 0x0400 ? xBits : 0;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        <span class="keywordtype">unsigned</span> rowB = yBits &amp; 0x0800 ? xBits : 0;</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        <span class="keywordtype">unsigned</span> rowC = yBits &amp; 0x1000 ? xBits : 0;</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        <span class="keywordtype">unsigned</span> rowD = yBits &amp; 0x2000 ? xBits : 0;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        <span class="keywordtype">unsigned</span> rowE = yBits &amp; 0x4000 ? xBits : 0;</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        <span class="keywordtype">unsigned</span> rowF = yBits &amp; 0x8000 ? xBits : 0;</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> result = {</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;            (row1 &lt;&lt; 16) | row0,</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;            (row3 &lt;&lt; 16) | row2,</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;            (row5 &lt;&lt; 16) | row4,</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;            (row7 &lt;&lt; 16) | row6,</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;            (row9 &lt;&lt; 16) | row8,</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;            (rowB &lt;&lt; 16) | rowA,</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;            (rowD &lt;&lt; 16) | rowC,</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;            (rowF &lt;&lt; 16) | rowE,</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;        };</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    }</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;</div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a07de976f0c00e150454fb36ac2214075">  101</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a07de976f0c00e150454fb36ac2214075" title="Erase a TileMask, setting all bits to zero.">clear</a>() {</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;        _SYS_memset32(&amp;row10, 0, 8);</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    }</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_mask.html#ab97ce40fed646524729aca0c602413cd">  108</a></span>&#160;    uint16_t *<a class="code" href="struct_sifteo_1_1_b_g1_mask.html#ab97ce40fed646524729aca0c602413cd" title="Get a pointer to the rows in this mask, as 16-bit integers.">rows</a>() {</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        <span class="keywordflow">return</span> (uint16_t*) <span class="keyword">this</span>;</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    }</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keyword">const</span> uint16_t *<a class="code" href="struct_sifteo_1_1_b_g1_mask.html#ab97ce40fed646524729aca0c602413cd" title="Get a pointer to the rows in this mask, as 16-bit integers.">rows</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        <span class="keywordflow">return</span> (<span class="keyword">const</span> uint16_t*) <span class="keyword">this</span>;</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    }</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div>
<div class="line"><a name="l00120"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a0f331fe3186529e834af6601818f723e">  120</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a0f331fe3186529e834af6601818f723e" title="Mark one tile in the bitmap, given as (x,y) coordinates.">plot</a>(<span class="keywordtype">unsigned</span> x, <span class="keywordtype">unsigned</span> y) {</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(x &lt; 16 &amp;&amp; y &lt; 16);</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g1_mask.html#ab97ce40fed646524729aca0c602413cd" title="Get a pointer to the rows in this mask, as 16-bit integers.">rows</a>()[y] |= 1 &lt;&lt; x;</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    }</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a042d7107de466ac06c05ce72cbd98bcc">  130</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a042d7107de466ac06c05ce72cbd98bcc" title="Mark one tile in the bitmap, given as a vector.">plot</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> pos) {</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a0f331fe3186529e834af6601818f723e" title="Mark one tile in the bitmap, given as (x,y) coordinates.">plot</a>(pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a>, pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a>);</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    }</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;</div>
<div class="line"><a name="l00139"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a3fcb59660c0907eb356ebc93b9e8156f">  139</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a3fcb59660c0907eb356ebc93b9e8156f" title="Mark a rectangular region of the bitmap.">fill</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> topLeft, <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> size) {</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> y = 0; y &lt; size.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a>; y++)</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;            <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> x = 0; x &lt; size.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a>; x++)</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;                <a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a0f331fe3186529e834af6601818f723e" title="Mark one tile in the bitmap, given as (x,y) coordinates.">plot</a>(topLeft.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> + x, topLeft.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> + y);</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    }</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;</div>
<div class="line"><a name="l00146"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a2113c1356e0cf3bbb467cbbad8ea25fc">  146</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> &amp; <a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a2113c1356e0cf3bbb467cbbad8ea25fc" title="Bitwise OR with another mask.">operator|= </a>(<a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> other) {</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;        row10 |= other.row10;</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        row32 |= other.row32;</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;        row54 |= other.row54;</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;        row76 |= other.row76;</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;        row98 |= other.row98;</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;        rowBA |= other.rowBA;</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;        rowDC |= other.rowDC;</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;        rowFE |= other.rowFE;</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    }</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;</div>
<div class="line"><a name="l00159"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a993e1e8eddf7b1725e4b3a34164215da">  159</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> &amp; <a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a993e1e8eddf7b1725e4b3a34164215da" title="Bitwise AND with another mask.">operator&amp;= </a>(<a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> other) {</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        row10 &amp;= other.row10;</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;        row32 &amp;= other.row32;</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;        row54 &amp;= other.row54;</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;        row76 &amp;= other.row76;</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;        row98 &amp;= other.row98;</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;        rowBA &amp;= other.rowBA;</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;        rowDC &amp;= other.rowDC;</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;        rowFE &amp;= other.rowFE;</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;        <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    }</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;</div>
<div class="line"><a name="l00172"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a25aa12638a9243a7c62d3b75cfeb511f">  172</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> &amp; <a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a25aa12638a9243a7c62d3b75cfeb511f" title="Bitwise XOR with another mask.">operator^= </a>(<a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> other) {</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;        row10 ^= other.row10;</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;        row32 ^= other.row32;</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;        row54 ^= other.row54;</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;        row76 ^= other.row76;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;        row98 ^= other.row98;</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;        rowBA ^= other.rowBA;</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;        rowDC ^= other.rowDC;</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;        rowFE ^= other.rowFE;</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;        <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    }</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;</div>
<div class="line"><a name="l00185"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a610959c1ed9434767b5f319d02880fc6">  185</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> <a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a610959c1ed9434767b5f319d02880fc6" title="Bitwise OR with another mask.">operator| </a>(<a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> other)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;         <a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> result = {</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;             row10 | other.row10,</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;             row32 | other.row32,</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;             row54 | other.row54,</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;             row76 | other.row76,</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;             row98 | other.row98,</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;             rowBA | other.rowBA,</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;             rowDC | other.rowDC,</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;             rowFE | other.rowFE,</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;        };</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;        <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    }</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div>
<div class="line"><a name="l00200"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a778bfbb03027dd9c650af6a3ad48a50b">  200</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> <a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a778bfbb03027dd9c650af6a3ad48a50b" title="Bitwise AND with another mask.">operator&amp; </a>(<a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> other)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;         <a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> result = {</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;             row10 &amp; other.row10,</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;             row32 &amp; other.row32,</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;             row54 &amp; other.row54,</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;             row76 &amp; other.row76,</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;             row98 &amp; other.row98,</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;             rowBA &amp; other.rowBA,</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;             rowDC &amp; other.rowDC,</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;             rowFE &amp; other.rowFE,</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;        };</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;        <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    }</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;</div>
<div class="line"><a name="l00215"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a52c9b388307876b8f148e057c3386653">  215</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> <a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a52c9b388307876b8f148e057c3386653" title="Bitwise XOR with another mask.">operator^ </a>(<a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> other)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;         <a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> result = {</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;             row10 ^ other.row10,</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;             row32 ^ other.row32,</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;             row54 ^ other.row54,</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;             row76 ^ other.row76,</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;             row98 ^ other.row98,</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;             rowBA ^ other.rowBA,</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;             rowDC ^ other.rowDC,</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;             rowFE ^ other.rowFE,</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;        };</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;        <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    }</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;</div>
<div class="line"><a name="l00230"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a7485607586cda96e1b80bec956ca410e">  230</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> <a class="code" href="struct_sifteo_1_1_b_g1_mask.html#a7485607586cda96e1b80bec956ca410e" title="Bitwise complement.">operator~ </a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;         <a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> result = {</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;             ~row10,</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;             ~row32,</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;             ~row54,</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;             ~row76,</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;             ~row98,</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;             ~rowBA,</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;             ~rowDC,</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;             ~rowFE,</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;        };</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;        <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    }</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;};</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;</div>
<div class="line"><a name="l00266"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html">  266</a></span>&#160;<span class="keyword">struct </span><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html" title="A VRAM accessor for drawing graphics in the BG1 mode.">BG1Drawable</a> {</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;    _SYSAttachedVideoBuffer sys;</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;</div>
<div class="line"><a name="l00272"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#aec287148138d909dcd3920e2d9bbee43">  272</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#aec287148138d909dcd3920e2d9bbee43" title="Return the width, in tiles, of this mode.">tileWidth</a>() {</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;        <span class="keywordflow">return</span> _SYS_VRAM_BG1_WIDTH;</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;    }</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;</div>
<div class="line"><a name="l00279"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a6f0f91f18a33841540ab6f15067725b2">  279</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a6f0f91f18a33841540ab6f15067725b2" title="Return the height, in tiles, of this mode.">tileHeight</a>() {</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;        <span class="keywordflow">return</span> _SYS_VRAM_BG1_WIDTH;</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;    }</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;</div>
<div class="line"><a name="l00286"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#afdadac83e322a5470d4d062c2174bc63">  286</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#afdadac83e322a5470d4d062c2174bc63" title="Return the size of this mode as a vector, in tiles.">tileSize</a>() {</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group__math.html#gab18c9af04a4a3a4a3c63656e40ab74ed" title="Create a Vector2, from a set of (x,y) coordinates.">vec</a>(<a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#aec287148138d909dcd3920e2d9bbee43" title="Return the width, in tiles, of this mode.">tileWidth</a>(), <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a6f0f91f18a33841540ab6f15067725b2" title="Return the height, in tiles, of this mode.">tileHeight</a>());</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;    }</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;</div>
<div class="line"><a name="l00293"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#abb678e7d82c2529ac25e21561d3e7e5a">  293</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#abb678e7d82c2529ac25e21561d3e7e5a" title="Return the width, in pixels, of this mode.">pixelWidth</a>() {</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#aec287148138d909dcd3920e2d9bbee43" title="Return the width, in tiles, of this mode.">tileWidth</a>() * 8;</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;    }</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;</div>
<div class="line"><a name="l00300"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a284c2f41acbf9a0247c71fbed5ac2557">  300</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a284c2f41acbf9a0247c71fbed5ac2557" title="Return the height, in pixel, of this mode.">pixelHeight</a>() {</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a6f0f91f18a33841540ab6f15067725b2" title="Return the height, in tiles, of this mode.">tileHeight</a>() * 8;</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;    }</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;</div>
<div class="line"><a name="l00307"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a4e52c998aed086ddd5b5df435b50e149">  307</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a4e52c998aed086ddd5b5df435b50e149" title="Return the size of this mode as a vector, in pixels.">pixelSize</a>() {</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group__math.html#gab18c9af04a4a3a4a3c63656e40ab74ed" title="Create a Vector2, from a set of (x,y) coordinates.">vec</a>(<a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#abb678e7d82c2529ac25e21561d3e7e5a" title="Return the width, in pixels, of this mode.">pixelWidth</a>(), <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a284c2f41acbf9a0247c71fbed5ac2557" title="Return the height, in pixel, of this mode.">pixelHeight</a>());</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;    }</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;</div>
<div class="line"><a name="l00314"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#ac97cf27407b3e316d5541b6daf2ba71e">  314</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#ac97cf27407b3e316d5541b6daf2ba71e" title="Returns the maximum number of allcoated tiles.">numTiles</a>() {</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;        <span class="keywordflow">return</span> _SYS_VRAM_BG1_TILES;</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;    }</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;</div>
<div class="line"><a name="l00323"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#ada6d7a6fdeb68c39016c479bd43d12a3">  323</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#ada6d7a6fdeb68c39016c479bd43d12a3" title="Erase mode-specific VRAM, filling the BG1 buffer with the specified absolute tile index value...">erase</a>(uint16_t index = 0) {</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a89fe17837b494d916f0234523c7d0198" title="Erase just the allocation mask. All tiles will now be unallocated, and BG1 will be fully transparent...">eraseMask</a>();</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;        _SYS_vbuf_fill(&amp;sys.vbuf, _SYS_VA_BG1_TILES / 2,</div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;            _SYS_TILE77(index), <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#ac97cf27407b3e316d5541b6daf2ba71e" title="Returns the maximum number of allcoated tiles.">numTiles</a>());</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#aa8bbbdbbac7ab7427b288a84e6fb4168" title="Change the hardware pixel-panning origin for this mode.">setPanning</a>(<a class="code" href="group__math.html#gab18c9af04a4a3a4a3c63656e40ab74ed" title="Create a Vector2, from a set of (x,y) coordinates.">vec</a>(0,0));</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;    }</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;</div>
<div class="line"><a name="l00335"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a96e65d49eb0d4334c8a6e62766326e13">  335</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a96e65d49eb0d4334c8a6e62766326e13" title="Erase mode-specific VRAM, filling the BG1 buffer with the first tile from the specified PinnedAssetIm...">erase</a>(<span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_pinned_asset_image.html" title="An AssetImage in which all tiles are stored sequentially in memory.">PinnedAssetImage</a> &amp;<a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a8926d9bd9fa361bed0545053b1f76257" title="Draw a full AssetImage frame, with its top-left corner at the specified location.">image</a>) {</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#ada6d7a6fdeb68c39016c479bd43d12a3" title="Erase mode-specific VRAM, filling the BG1 buffer with the specified absolute tile index value...">erase</a>(image.<a class="code" href="struct_sifteo_1_1_pinned_asset_image.html#acae95d334dc7ae91830e26cc8389bcb4" title="Returns the index of the tile at linear position &#39;i&#39; in the image.">tile</a>(sys.cube, 0));</div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;    }</div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;</div>
<div class="line"><a name="l00343"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#adf750af7dc3c738415ddafe548c110fe">  343</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#adf750af7dc3c738415ddafe548c110fe" title="Fill all BG1 tiles with the specified absolute index, without modifying the allocation mask...">fill</a>(uint16_t index = 0) {</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;        _SYS_vbuf_fill(&amp;sys.vbuf, _SYS_VA_BG1_TILES / 2,</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;            _SYS_TILE77(index), <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#ac97cf27407b3e316d5541b6daf2ba71e" title="Returns the maximum number of allcoated tiles.">numTiles</a>());</div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;    }</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;</div>
<div class="line"><a name="l00352"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#aad569985b99fbc54ba1e43241127aa8d">  352</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#aad569985b99fbc54ba1e43241127aa8d" title="Fill all BG1 tiles with first tile from the specified PinnedAssetImage, without modifying the allocat...">fill</a>(<span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_pinned_asset_image.html" title="An AssetImage in which all tiles are stored sequentially in memory.">PinnedAssetImage</a> &amp;<a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a8926d9bd9fa361bed0545053b1f76257" title="Draw a full AssetImage frame, with its top-left corner at the specified location.">image</a>) {</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#adf750af7dc3c738415ddafe548c110fe" title="Fill all BG1 tiles with the specified absolute index, without modifying the allocation mask...">fill</a>(image.<a class="code" href="struct_sifteo_1_1_pinned_asset_image.html#acae95d334dc7ae91830e26cc8389bcb4" title="Returns the index of the tile at linear position &#39;i&#39; in the image.">tile</a>(sys.cube, 0));</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;    }</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;</div>
<div class="line"><a name="l00369"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a89fe17837b494d916f0234523c7d0198">  369</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a89fe17837b494d916f0234523c7d0198" title="Erase just the allocation mask. All tiles will now be unallocated, and BG1 will be fully transparent...">eraseMask</a>() {</div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;        _SYS_finish();</div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;        _SYS_vbuf_fill(&amp;sys.vbuf, _SYS_VA_BG1_BITMAP/2, 0, _SYS_VRAM_BG1_WIDTH);</div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;    }</div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;</div>
<div class="line"><a name="l00386"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#aa882eda876812923a7c2e5c7aa75e920">  386</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#aa882eda876812923a7c2e5c7aa75e920" title="Change the tile allocation bitmap.">setMask</a>(<span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_b_g1_mask.html" title="A BG1 tile mask. In other words, this is a 16x16-bit two-dimensional vector.">BG1Mask</a> &amp;mask) {</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;        _SYS_finish();</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;        _SYS_vbuf_write(&amp;sys.vbuf, <a class="code" href="group__macros.html#gafef9199621fafa1bd046611921ab061f">offsetof</a>(_SYSVideoRAM, bg1_bitmap)/2,</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;            mask.<a class="code" href="struct_sifteo_1_1_b_g1_mask.html#ab97ce40fed646524729aca0c602413cd" title="Get a pointer to the rows in this mask, as 16-bit integers.">rows</a>(), 16);</div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;    }</div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;</div>
<div class="line"><a name="l00413"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a90de1df00dbb4cd1c891ad18288a7f6f">  413</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a90de1df00dbb4cd1c891ad18288a7f6f" title="This is a specialized alternative to setMask(), for cases where each row of BG1 has a single contiguo...">fillMask</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> topLeft, <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> size) {</div>
<div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;        _SYS_finish();</div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;        _SYS_vbuf_fill(&amp;sys.vbuf,</div>
<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;            <a class="code" href="group__macros.html#gafef9199621fafa1bd046611921ab061f">offsetof</a>(_SYSVideoRAM, bg1_bitmap)/2 + topLeft.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a>,</div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;            ((1 &lt;&lt; size.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a>) - 1) &lt;&lt; topLeft.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a>, size.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a>);</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;    }</div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;</div>
<div class="line"><a name="l00430"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#aa8bbbdbbac7ab7427b288a84e6fb4168">  430</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#aa8bbbdbbac7ab7427b288a84e6fb4168" title="Change the hardware pixel-panning origin for this mode.">setPanning</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">Int2</a> pixels) {</div>
<div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;        <span class="keywordtype">unsigned</span> x = pixels.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> &amp; 0xFF;</div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;        <span class="keywordtype">unsigned</span> y = pixels.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> &amp; 0xFF;</div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;        _SYS_vbuf_poke(&amp;sys.vbuf, <a class="code" href="group__macros.html#gafef9199621fafa1bd046611921ab061f">offsetof</a>(_SYSVideoRAM, bg1_x) / 2, x | (y &lt;&lt; 8));</div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;    }</div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;</div>
<div class="line"><a name="l00439"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a0006f655a79db93548f22d0bcda29bc6">  439</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">Int2</a> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a0006f655a79db93548f22d0bcda29bc6" title="Retrieve the last value set by setPanning(). .">getPanning</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;        <span class="keywordtype">unsigned</span> word = _SYS_vbuf_peek(&amp;sys.vbuf, <a class="code" href="group__macros.html#gafef9199621fafa1bd046611921ab061f">offsetof</a>(_SYSVideoRAM, bg0_x) / 2);</div>
<div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;        <span class="keywordflow">return</span> vec&lt;int&gt;((int8_t)(word &amp; 0xFF), (int8_t)(word &gt;&gt; 8));</div>
<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;    }</div>
<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;</div>
<div class="line"><a name="l00448"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#aca3ae5972d58d2236e6541d5e7a6767e">  448</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#aca3ae5972d58d2236e6541d5e7a6767e" title="Plot a single tile, by absolute tile index, at a specific location in the 144-tile array...">plot</a>(<span class="keywordtype">unsigned</span> locationIndex, uint16_t tileIndex) {</div>
<div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(locationIndex &lt; <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#ac97cf27407b3e316d5541b6daf2ba71e" title="Returns the maximum number of allcoated tiles.">numTiles</a>());</div>
<div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;        _SYS_vbuf_poke(&amp;sys.vbuf, _SYS_VA_BG1_TILES / 2 + locationIndex,</div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;            _SYS_TILE77(tileIndex));</div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;    }</div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;</div>
<div class="line"><a name="l00460"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#af38cfcf6ac8cc513c3c60fa561d665b5">  460</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#af38cfcf6ac8cc513c3c60fa561d665b5" title="Plot a horizontal span of tiles in consecutively allocated locations in the BG1 tile array...">span</a>(<span class="keywordtype">unsigned</span> locationIndex, <span class="keywordtype">unsigned</span> count, <span class="keywordtype">unsigned</span> tileIndex)</div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;    {</div>
<div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(locationIndex &lt;= <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#ac97cf27407b3e316d5541b6daf2ba71e" title="Returns the maximum number of allcoated tiles.">numTiles</a>() &amp;&amp; count &lt;= <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#ac97cf27407b3e316d5541b6daf2ba71e" title="Returns the maximum number of allcoated tiles.">numTiles</a>() &amp;&amp;</div>
<div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;            (locationIndex + count) &lt; <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#ac97cf27407b3e316d5541b6daf2ba71e" title="Returns the maximum number of allcoated tiles.">numTiles</a>());</div>
<div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;        _SYS_vbuf_fill(&amp;sys.vbuf, _SYS_VA_BG1_TILES / 2 + locationIndex,</div>
<div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;            _SYS_TILE77(tileIndex), count);</div>
<div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;    }</div>
<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;</div>
<div class="line"><a name="l00479"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a8926d9bd9fa361bed0545053b1f76257">  479</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a8926d9bd9fa361bed0545053b1f76257" title="Draw a full AssetImage frame, with its top-left corner at the specified location.">image</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> pos, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> &amp;<a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a8926d9bd9fa361bed0545053b1f76257" title="Draw a full AssetImage frame, with its top-left corner at the specified location.">image</a>, <span class="keywordtype">unsigned</span> frame = 0)</div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;    {</div>
<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;        _SYS_image_BG1Draw(&amp;sys, image, (_SYSInt2*) &amp;pos, frame);</div>
<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;    }</div>
<div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;</div>
<div class="line"><a name="l00495"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a43ae1cbd30c7060cbe1f331bc277af2e">  495</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a8926d9bd9fa361bed0545053b1f76257" title="Draw a full AssetImage frame, with its top-left corner at the specified location.">image</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> destXY, <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> size, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> &amp;<a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a8926d9bd9fa361bed0545053b1f76257" title="Draw a full AssetImage frame, with its top-left corner at the specified location.">image</a>, <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> srcXY, <span class="keywordtype">unsigned</span> frame = 0)</div>
<div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;    {</div>
<div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;        _SYS_image_BG1DrawRect(&amp;sys, image, (_SYSInt2*) &amp;destXY,</div>
<div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;            frame, (_SYSInt2*) &amp;srcXY, (_SYSInt2*) &amp;size);</div>
<div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;    }</div>
<div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;</div>
<div class="line"><a name="l00513"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a932f2739ebaeae983f25679ed648faf2">  513</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a932f2739ebaeae983f25679ed648faf2" title="Draw an AssetImage, automatically allocating tiles on the BG1 mask.">maskedImage</a>(<span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> &amp;<a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a8926d9bd9fa361bed0545053b1f76257" title="Draw a full AssetImage frame, with its top-left corner at the specified location.">image</a>, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_pinned_asset_image.html" title="An AssetImage in which all tiles are stored sequentially in memory.">PinnedAssetImage</a> &amp;key,</div>
<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;        <span class="keywordtype">unsigned</span> frame = 0)</div>
<div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;    {</div>
<div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;        _SYS_finish();</div>
<div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;        _SYS_image_BG1MaskedDraw(&amp;sys, image, key.<a class="code" href="struct_sifteo_1_1_pinned_asset_image.html#acae95d334dc7ae91830e26cc8389bcb4" title="Returns the index of the tile at linear position &#39;i&#39; in the image.">tile</a>(sys.cube, 0), frame);</div>
<div class="line"><a name="l00518"></a><span class="lineno">  518</span>&#160;    }</div>
<div class="line"><a name="l00519"></a><span class="lineno">  519</span>&#160;</div>
<div class="line"><a name="l00533"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#aaf1c0b29248dcf2ffbab62a14640ad2b">  533</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a932f2739ebaeae983f25679ed648faf2" title="Draw an AssetImage, automatically allocating tiles on the BG1 mask.">maskedImage</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> size, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> &amp;<a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a8926d9bd9fa361bed0545053b1f76257" title="Draw a full AssetImage frame, with its top-left corner at the specified location.">image</a>,</div>
<div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;        <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_pinned_asset_image.html" title="An AssetImage in which all tiles are stored sequentially in memory.">PinnedAssetImage</a> &amp;key, <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> srcXY,</div>
<div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160;        <span class="keywordtype">unsigned</span> frame = 0)</div>
<div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;    {</div>
<div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160;        _SYS_finish();</div>
<div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160;        _SYS_image_BG1MaskedDrawRect(&amp;sys, image, key.<a class="code" href="struct_sifteo_1_1_pinned_asset_image.html#acae95d334dc7ae91830e26cc8389bcb4" title="Returns the index of the tile at linear position &#39;i&#39; in the image.">tile</a>(sys.cube, 0), frame,</div>
<div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160;            (_SYSInt2*) &amp;srcXY, (_SYSInt2*) &amp;size);</div>
<div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;    }</div>
<div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;</div>
<div class="line"><a name="l00548"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#aaec83344a2416b8142baedd00b663bfb">  548</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#aaec83344a2416b8142baedd00b663bfb" title="Draw text, using an AssetImage as a fixed width font.">text</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">Int2</a> topLeft, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> &amp;font, <span class="keyword">const</span> <span class="keywordtype">char</span> *str, <span class="keywordtype">char</span> firstChar = <span class="charliteral">&#39; &#39;</span>)</div>
<div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;    {</div>
<div class="line"><a name="l00550"></a><span class="lineno">  550</span>&#160;        <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">Int2</a> pos = topLeft;</div>
<div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160;        <span class="keywordtype">char</span> c;</div>
<div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;</div>
<div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;        <span class="keywordflow">while</span> ((c = *str)) {</div>
<div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;            <span class="keywordflow">if</span> (c == <span class="charliteral">&#39;\n&#39;</span>) {</div>
<div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;                pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> = topLeft.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a>;</div>
<div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;                pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> += font.<a class="code" href="struct_sifteo_1_1_asset_image.html#a7ff2fd5e83e49e79b376df2c8b156bbd" title="The height of this image, in tiles.">tileHeight</a>();</div>
<div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;                _SYS_image_BG1Draw(&amp;sys, font, (_SYSInt2*) &amp;pos, c - firstChar);</div>
<div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;                pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> += font.<a class="code" href="struct_sifteo_1_1_asset_image.html#adaba620b7063de2be6abba13e9857169" title="The width of this image, in tiles.">tileWidth</a>();</div>
<div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;            }</div>
<div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;            str++;</div>
<div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160;        }</div>
<div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160;    }</div>
<div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160;</div>
<div class="line"><a name="l00568"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a105b9fb8bb3483a0c5d72f0c44163a24">  568</a></span>&#160;    _SYSVideoBuffer &amp;<a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a105b9fb8bb3483a0c5d72f0c44163a24" title="Return the VideoBuffer associated with this drawable.">videoBuffer</a>() {</div>
<div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;        <span class="keywordflow">return</span> sys.vbuf;</div>
<div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160;    }</div>
<div class="line"><a name="l00571"></a><span class="lineno">  571</span>&#160;</div>
<div class="line"><a name="l00575"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a046aee3e3a4e79e2c76b69a7407016a0">  575</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_cube_i_d.html" title="A lightweight identifier for one Sifteo cube.">CubeID</a> <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html#a046aee3e3a4e79e2c76b69a7407016a0" title="Return the CubeID associated with this drawable.">cube</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;        <span class="keywordflow">return</span> sys.cube;</div>
<div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;    }</div>
<div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;};</div>
<div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;</div>
<div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;};  <span class="comment">// namespace Sifteo</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
    <hr class="footer"/>
    <address class="footer">
        <p><a href="http://sifteo.com">Sifteo</a> SDK v1.0.0 <small>(see <a href="https://developers.sifteo.com/sifteosdk">all versions</a>)</small></p>
        <p>Last updated Wed Mar 27 2013, by <a href="http://www.stack.nl/~dimitri/doxygen">Doxygen</a></p>
    </address>
</body>
</html>
